using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class vItemReturnMap : EntityTypeConfiguration<vItemReturn>
    {
        public vItemReturnMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Item, t.Date });

            // Properties
            this.Property(t => t.Item)
                .IsRequired()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("vItemReturns");
            this.Property(t => t.Item).HasColumnName("Item");
            this.Property(t => t.RetQty).HasColumnName("RetQty");
            this.Property(t => t.RetCostAMount).HasColumnName("RetCostAMount");
            this.Property(t => t.RettotalAMount).HasColumnName("RettotalAMount");
            this.Property(t => t.Date).HasColumnName("Date");
        }
    }
}
